package com.gujh.fluent;

import cn.org.atool.generator.FileGenerator;
import cn.org.atool.generator.annotation.Table;
import cn.org.atool.generator.annotation.Tables;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class AppEntityGenerator {
    static final String url = "jdbc:mysql://101.35.187.114:3306/test?useUnicode=true&characterEncoding=utf8";
    // 数据库用户名
    static final String username = "root";
    // 数据库密码
    static final String password = "jiahe0528";

    @Test
    void generate() {
        FileGenerator.build(Abc.class);
    }

    @Tables(
            // 设置数据库连接信息
            url = url, username = username, password = password,
            // 设置entity类生成src目录, 相对于 user.dir
            srcDir = "src/main/java",
            /* Entity类parent package路径 **/
            basePack = "com.gujh.fluent",
            /* Dao代码源目录 **/
            daoDir = "src/main/java",
            tables = {@Table(value = {"hello_world"})}
    )
    static class Abc {
    }
}
